package com.itheima.properties;

import java.io.*;
import java.util.Properties;

public class PropertiesDemo {
    public static void main(String[] args) throws IOException {
        Properties properties = new Properties();
        properties.setProperty("王宝强","马蓉");
        properties.setProperty("贾乃亮","李小璐");
        properties.setProperty("武大郎","潘金莲");
        //System.out.println(properties);
        properties.store(new BufferedOutputStream(new FileOutputStream("Day16\\properties1.txt")),null);
        properties.store(new FileWriter(new File("Day16\\properties.txt")),null);
        Properties properties1 = new Properties();
        properties1.load(new BufferedReader(new FileReader(new File("Day16\\properties.txt"))));
        System.out.println(properties1);
        Properties properties2 = new Properties();
        properties2.load(new BufferedInputStream(new FileInputStream(new File("Day16\\properties1.txt"))));
        System.out.println(properties2);
    }
}
